const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;
// mock一组数据
const produceNewsData = function() {
    let photoinfo = [];
    for (let i = 0; i < 1; i++) {
        let newArticleObject = {

            title: Random.csentence(5, 10),
            content: Random.csentence(50, 100), //  Random.csentence( min, max )
            // imgs: [Random.dataImage('300x250', 'mock1的图片'), Random.dataImage('300x250', 'mock2的图片'),
            //     Random.dataImage('300x250', 'mock3的图片'), Random.dataImage('300x250', '4'),
            //     Random.dataImage('300x250', '5的图片')
            // ],
            click: (1 + i),
            add_time: Random.date()
        }
        photoinfo.push(newArticleObject)
    }

    return {
        photoinfo: photoinfo
    }
}

// Mock.mock( url, post/get , 返回的数据)；
Mock.mock('/news/photoinfo', 'get', produceNewsData);